package devyouk.util.excel.cellAdapter;

import com.google.common.base.Strings;
import org.apache.poi.ss.usermodel.CellType;

class StringToDoubleAdapter extends CellValueAdapter<String,Double> {

    @Override
    public CellType getCellType() {
        return CellType.NUMERIC;
    }

    @Override
    public Double getCellValue(String data) {
        if (Strings.isNullOrEmpty(data)) {
            return null;
        }
        return Double.parseDouble(data);
    }
}
